#define  _CRT_SECURE_NO_WARNINGS 1

typedef struct ListNode ListNode;
int kthToLast(struct ListNode* head, int k)
{
    if (head == NULL)
    {
        return head;
    }
    ListNode* pcur, * p;
    pcur = p = head;
    int sum = 0;
    while (pcur)
    {
        sum++;
        pcur = pcur->next;
    }
    int count = sum - k;

    while (count--)
    {
        p = p->next;
    }
    return p->val;

}
